import string
import re

keys = string.digits + '+/' + string.ascii_lowercase + string.ascii_uppercase
print(keys)

def encrypt(code):
    st = re.findall('.{3}', code)
    print(st)
    st.append(code[(len(st) * 3):])
    print(st)
    bins = ''
    for s in st:
        for i in s:
            bins += bin(ord(i)).replace('0b', '').rjust(8, '0')
            print(bins)
    bt = re.findall('.{6}', bins)
    print(bt)
    bt.append(bins[(len(bt) * 6):])
    print(bt)
    res = ''
    for b in bt:
        res += keys[int(b.ljust(6, '0'), 2)]
        print(b.ljust(6, '0'))
    res += '=' * (4 - (len(bt) % 4))
    return res

flag="flag{ija3fajfoajfalfjaf}"
c=encrypt(flag)
print(c)